﻿namespace Example
{
    using NodaTime;

    using Xunit;

    public sealed class NodaTimeLocalDateFacts
    {
        [Fact]
        public void ctor_int_int_int_CalendarSystem()
        {
            var expected = new LocalDate(2010, 6, 16);
            var actual = new LocalDate(2010, 6, 16, CalendarSystem.Iso);

            Assert.Equal(expected, actual);
        }

        [Fact]
        public void opAddition_LocalDate_LocalTime()
        {
            var date = new LocalDate(2010, 6, 16);
            var time = new LocalTime(16, 20, 0);

            var expected = new LocalDateTime(2010, 6, 16, 16, 20, 0);
            var actual = date + time;

            Assert.Equal(expected, actual);
        }

        [Fact]
        public void op_ToString_string()
        {
            const string expected = "2010-06-16";
            var actual = new LocalDate(2010, 6, 16).ToString("yyyy-MM-dd");

            Assert.Equal(expected, actual);
        }
    }
}